package cn.wolfcode.wolf.redis.key;

import lombok.Setter;

import java.util.concurrent.TimeUnit;

/**
 * 基础RedisKey前缀类
 */
@Setter
public class BaseKeyPrefix implements KeyPrefix{
    private String prefix;
    private Long timeout;
    private TimeUnit timeUnit;
    public BaseKeyPrefix(String prefix) {
        this(prefix,-1L,null);
    }

    public BaseKeyPrefix(String prefix, Long timeout ,TimeUnit timeUnit) {
        this.prefix=prefix;
        this.timeout=timeout;
        this.timeUnit=timeUnit;
    }

    @Override
    public String getPrefix() {
        return prefix;
    }

    @Override
    public Long getTimeout() {
        return timeout;
    }

    @Override
    public TimeUnit getUnit() {
        return timeUnit;
    }
}
